package cn.yi.fast.security.response;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R<T> implements Serializable {
    private int code;
    private String message;
    private T data;

    public static <T> R success(T data) {
        return new R(0,"success",data);
    }

    public static R error(String message) {
        return new R(1,message,null);
    }
}
